package com.wanmait.community.controller;

import com.wanmait.community.entity.BeforeRepairPic;
import com.wanmait.community.service.AdminRepairService;
import com.wanmait.community.service.BeforeRepairPicService;
import com.wanmait.community.util.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("beforeRepairPic")
public class BeforeRepairPicController {
    @Resource
    private BeforeRepairPicService beforeRepairPicService;
    @Resource
    private AdminRepairService adminRepairService;
    @GetMapping("list")
    public AjaxResult list() {
        List<BeforeRepairPic> list = beforeRepairPicService.findAllList();//findAllList是多表关联admin_repair
        return AjaxResult.success().put("list", list);
    }
    @PostMapping("insert")
    public AjaxResult insert(@RequestBody BeforeRepairPic beforeRepairPic) {
        beforeRepairPicService.insertBeforeRepairPic(beforeRepairPic);
        return AjaxResult.success("报修成功");
    }


}
